import request from '@/utils/request'

export function getMenuList (params) {
  return request({
    url: '/api/menu/list',
    method: 'GET',
    params
  })
}

export function menuAdd (params) {
  return request({
    url: '/api/menu/add',
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: params
  })
}

export function menuDetail (params) {
  return request({
    url: '/api/menu/deTail',
    method: 'GET',
    params
  })
}
export function menuUpdate (params) {
  return request({
    url: '/api/menu/update',
    method: 'POST',
    data: params
  })
}
export function menuDelete (params) {
  return request({
    url: '/api/menu/delete',
    method: 'DELETE',
    params
  })
}

export function getRoleList (params) {
  return request({
    url: '/api/role/list',
    method: 'GET',
    params
  })
}

export function roleAdd (params) {
  return request({
    url: '/api/role/add',
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: params
  })
}

export function roleDetail (params) {
  return request({
    url: '/api/role/detail',
    method: 'GET',
    params
  })
}
export function roleUpdate (params) {
  return request({
    url: '/api/role/update',
    method: 'POST',
    data: params
  })
}
export function roleDelete (params) {
  return request({
    url: '/api/role/delete',
    method: 'DELETE',
    params
  })
}

export function updateRoleMenu (params) {
  return request({
    url: '/api/role/updateRoleMenu',
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: params
  })
}

export function departmentList (params) {
  return request({
    url: '/api/department/list',
    method: 'GET',
    params
  })
}
export function departmentAdd (params) {
  return request({
    url: '/api/department/add',
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: params
  })
}

export function departmentUpdate (params) {
  return request({
    url: '/api/department/update',
    method: 'POST',
    data: params
  })
}

export function resetPasswordApi (params) {
  return request({
    url: '/api/user/resetPassword',
    method: 'POST',
    params
  })
}
export function departmentDelete (params) {
  return request({
    url: '/api/department/delete',
    method: 'DELETE',
    params
  })
}

export function userList (params) {
  return request({
    url: '/api/user/pageList',
    method: 'POST',

    data: params
  })
}
export function userAdd (params) {
  return request({
    url: '/api/user/add',
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: params
  })
}

export function userUpdate (params) {
  return request({
    url: '/api/user/update',
    method: 'POST',
    data: params
  })
}
export function userDelete (params) {
  return request({
    url: '/api/user/delete',
    method: 'DELETE',
    params
  })
}
export function userDetail (params) {
  return request({
    url: '/api/user/deTail',
    method: 'GET',
    params
  })
}
export function updatePassword (params) {
  return request({
    url: '/api/user/updatePassword',
    method: 'POST',
    data: params
  })
}
